package game.Menus;

import game.ActionListener;

import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Vector2f;

/**
 * 
 * @author Sebastian Isheden and Victor Beer.
 *
 */
public abstract class MenuItem {
	private ActionListener action;
	/**
	 * Creates a new menu item.
	 * @param action THe action the item will perform when called.
	 */
	public MenuItem(ActionListener action){
		this.action = action;
	}
	
	/**
	 * Prints the item to the screen.
	 * @param graphic The graphic.
	 * @param position The position to print the itam at.
	 * @param selected If the item is selected.
	 */
	public abstract void print(Graphics graphic, Vector2f position, boolean selected);
	
	/**
	 * Performes the aciton stored in the item.
	 */
	public void press() {
		action.action();
	}

}
